Title: FTP Site List to Database Conversion Author: Mark R. Rinfret (mrr@mrsoft.network23.com) Date: 12/23/94 History: 12/23/94,MRR: Added URL attribute. 11/29/94,MRR: Program creation. ********************************************************************** Description: Perry Rovers (Perry.Rovers@kub.nl) maintains and distributes an extensive list of international FTP sites. The list is distributed as a series of tagged ASCII text files. While the content is invaluable, the format is somewhat difficult to navigate. I have created a simple C program which will convert Perry's list into a text file of records (1 line = one record) containing quote-delimited, comma-separated values. The resulting file is suitable for importing into any of a number of database products, including Microsoft Access 2.0, my choice. To prepare the raw input file for conversion, all of the list segments (Usenet articles) must be concatenated into one large file. Be sure to save the articles without mail headers or delete all mail headers before processing the list. The list will contain a fair amount of introductory text explaining the list format. This can be left in. Just before the first actual site definition, insert the following string, left-justified: BEGIN_FTP_LIST Thus, the first part of the prepared (raw) list will look like this: BEGIN_FTP_LIST Site : 161.105.2.22 Country: France GMT : +1 Date : 31-Jul-94 Source : Yves.Dehery@ccett.fr Alias : etocs Admin : Organ : Centre Commun d'Etude de Telecommunication et de Telediffusion (joint France Telecom and TDF research center, CCETT), Rennes Server : System : Unix Comment: MPEG compression - MPEG bit-streams - MPEG software; THIS IS A TEMPORARY ENTRY [this site must get a name soon] Files : MPEG: audio (decod, parser, sound), video (ccett) Site : a.cs.uiuc.edu Country: USA GMT : -6 Date : 11-Mar-94 Source : old ftp-list Alias : Admin : Organ : University of Illinois - Urbana/Champaign, Urbana, Illinois, CS dept. Server : System : Unix Comment: max. 60 users; Problem: Failed to get host information Files : achien; AutoClassII; FWF; locally developed software: ACSL, CHARM, Choices, edebug, edels, epoch-files, era, perts, RT, SME, treemacs; networking; PDC; PEXpapers; QPE; Qual; ROLOG; sattrack; sbprolog; Sun3; Sun4; tech-reports; timex; UNO; vi; womcs (End of example) Save this file as "ftp.raw". Next, run the program PACKFTP.EXE from the DOS command line prompt to create the database import file, "ftp.imp": packftp ftp.raw ftp.imp What you do next depends upon what you intend to do with the data. I chose to import it into a Microsoft Access 2.0 database. You might want to use some other database product, spreadsheet, etc. If you choose to use my included Access database, open the included database, named "FTPSITE.MDB". The database is preloaded with a recent copy of the FTP Site List data. Go ahead and play with it a bit. Select the Form view in the Database window, then double-click on the FTPSites form entry. A form will open displaying the first record in the database. The default query underlying this form is one which yields all sites in site name order. When you are ready to import the converted data, select the Macro view in the Database window, then double-click on the ImportData macro name. All records in the database are first deleted and then the new data is imported. Feel free to alter the database to suit your needs. Its minimal capabilities were enough to serve my purposes. If you don't have Microsoft Access 2.0 but you're curious, I've included a bitmap file, ACCESS.BMP, which you can view in Windows Paintbrush. This distribution also includes the source and project definition file for the PACKFTP program. I used Borland C++ 4.0 to build the program, but it's plain vanilla and should compile with just about anything. Enjoy! Mark Rinfret